function ad_site_info(idx){
	$.getJSON('../../ajax/ad_site_info.php?idx='+ idx, function (data){
	  if (data.length > 0) {
		 var temp ='<table>';
		 // alert(data.length);
		 //alert(data[0]['s_name']);
		 temp +='<tr>';
		 temp +='<td width="130">커미션타입</td>';
		 temp +='<td><input type="text" name="s_cms_type" size="30" value="'+data[0]['s_cms_type']+'" readonly></td>';
		 temp +='</tr>';
		 temp +='<tr>';
		 temp +='<td width="">타입별</td>';
		 temp +='<td><input type="text" name="s_ad_type" size="30" value="'+data[0]['s_ad_type']+'" readonly></td>';
		 temp +='</tr>';
		 temp +='<tr>';
		 temp +='<td width="">타입별커미션</td>';
		 temp +='<td><input type="text" name="s_ad_cms" size="30" value="'+data[0]['s_ad_default_cms']+'"></td>';
		 temp +='</tr>';
		 temp +='<tr>';
		 temp +='<td width="">카테고리별</td>';
		 temp +='<td><input type="text" name="s_cate_code" size="30" value="'+data[0]['s_cate_code']+'"></td>';
		 temp +='</tr>';
		 temp +='<tr>';
		 temp +='<td width="">카테고리별커미션</td>';
		 temp +='<td><input type="text" name="s_cate_cms" size="30" value="'+data[0]['s_cate_default_cms']+'"></td>';
		 temp +='</tr>';
		 temp +='</table>';
	  }
	  //alert(temp);
		$("#div_ad").html(temp);
	});
}




function s_search(s_idx,c_idx){
	
	

	var temp ='';
	$.getJSON('../../ajax/s_search.php?s_idx='+ s_idx, function (data){
		if (data.length > 0) {
		temp +='<select class="input1" style="width:120px" name="c_idx" id="c_idx">';
		for(var i =0; i < data.length; i++){
			var selected = '';
			if(data[i]['c_idx'] == c_idx){ selected = 'selected' ; }
			temp +='<option value="'+data[i]['c_idx']+'" '+selected+'>'+ data[i]['s_ad_cms_type_str'] +'</option>';
		}
		temp +='</select>';
		}
	$("#div_search").html(temp);
	});
	if(!s_idx){$("#div_search").html(temp);}
}

function ajax_ad_go_click(c_idx){
/*
	$.ajax({
		type: "POST",
		url: "../ajax/ad_go_click.php",
		data: "c_idx="+ c_idx ,
		success: function(msg){
			//alert(msg);
			var addWin = window.open('about:blank');  
			addWin.location.href = 'http://'+msg;
		}
	});
*/
document.location.href="../ajax/ad_go_click.php?c_idx="+ c_idx;

}